% Levy
% Levy has global optimal at 0 in range [-10,10]
function result = Levy(x)
result = 0;
len = length(x);
for i = 1:len - 1
    temp = (x(i) - 1)^2 * (1 + sin(3*pi*x(i+1))^2);
    result = result + temp;
end
result = result + sin(3*pi*x(1))^2 + abs(x(len) - 1) * (1 + sin(3*pi*x(len))^2);
end